<template>
	<view class="container">
		<uni-forms ref="form" :rules="{}">
			<uni-forms-item label="" name="">
				<uni-easyinput  v-model="user.username" placeholder="请输入用户名" />
			</uni-forms-item>
			<uni-forms-item label="" name="">
				<uni-easyinput  type="password" v-model="user.password" placeholder="请输入密码"/>
			</uni-forms-item>
			<uni-forms-item label="" name="">
				<button type="primary" @click="login">登录</button>
			</uni-forms-item>
		</uni-forms>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{
					username:'tom',
					password:'123'
				}
			}
		},
		methods: {
			login(e){
				console.log(e);
				uni.showToast({
					title: this.user.username+'登录成功'
				});
			}
		},
		onLoad: () => {
			uni.onTabBarMidButtonTap(function(e){
				console.log(e)
				
			})
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>
